<?php
	class Partial
	{
		public $Content;
		private $file_path;
		
		public function __construct ( $file_path, $data )
		{
			$this->file_path = $file_path;
		
			if( is_array($data) )
			{
				foreach( $data as $key => $value )
				{
					$this->$key = $value;
				}
			}
			else if( is_object($data) )
			{
				foreach( get_object_vars($data) as $key => $value )
				{
					$this->$key = $value;
				}
			}
			
			$this->get_partial_contents();
		}
		
		# ----------------------------------------------------
		
		private function get_partial_contents()
		{
			ob_start();
			
			include $this->file_path;
			
			$this->Content = ob_get_contents(); 
			ob_end_clean(); 
		}
		
	}
?>